<template>
	<el-row :gutter="10">
      <el-col :span="2">
      任务间隔(秒)
      </el-col>
      <el-col :span="6">
            <el-input v-model="value" placeholder=""></el-input>
      </el-col>
      <el-col :span="2">
                 <el-button type="primary" @click="againSet()">重新设置</el-button>
      </el-col>
	</el-row>
</template>
<script>
export default {
    data(){
        return {
           value:"",
           code:""

        }
    },
    methods: {
        //重新设置
       againSet:function(){
           var data = {
               Code:this.code,
               Value:this.value
           }
        this.$httpRequest.post("api/CommonItem/SetByCode",data,res=>{
           debugger
           if(res.isSuccess){
                   this.$notify({
          title: '成功',
          message: '修改',
          type: 'success'
        });
           }else{
                this.$notify.error({
          title: '失败',
          message: res.message
        });
           }
        })
       }
    },
   	mounted() {
           var data = {
               Code:'001'
           }
		this.$httpRequest.get('api/CommonItem/GetByCode',data,res=>{
            debugger
            this.value = res.data.value;
            this.code = res.data.code;
        })
	},
}
</script>
